package com.jmult.crop.model;

import java.util.Date;

public class ImageModel implements Comparable<ImageModel> {

	private String name;
	private long lastModified;
	private Date createTime;
	private String url;

	public ImageModel(String name, long lastModified, Date createTime, String url) {
		this.name = name;
		this.lastModified = lastModified;
		this.createTime = createTime;
		this.url = url;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public long getLastModified() {
		return lastModified;
	}

	public void setLastModified(long lastModified) {
		this.lastModified = lastModified;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public int compareTo(ImageModel img) {
		long diff = this.lastModified - img.getLastModified();
		if (diff > 0)
			return -1;
		else if (diff == 0)
			return 0;
		else
			return 1;
	}

}
